package com.fimmlps.reronge.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("actor_triggers_singles")
public class ActorTriggersSingles implements Serializable {

  @MppMultiId
  @TableField("entry_trigger_id")
  private Integer entryTriggerId;


  @MppMultiId
  @TableField("actor_single_id")
  private Integer actorSingleId;


  public Integer getEntryTriggerId() {
    return entryTriggerId;
  }

  public void setEntryTriggerId(Integer entryTriggerId) {
    this.entryTriggerId = entryTriggerId;
  }


  public Integer getActorSingleId() {
    return actorSingleId;
  }

  public void setActorSingleId(Integer actorSingleId) {
    this.actorSingleId = actorSingleId;
  }

  public static List<Integer> toTIDList(List<ActorTriggersSingles> list){
    List<Integer> tidList = new ArrayList<>();
    for(ActorTriggersSingles single:list){
      if(!tidList.contains(single.getEntryTriggerId()))
        tidList.add(single.getEntryTriggerId());
    }
    return tidList;
  }

  public static List<Integer> toSIDList(List<ActorTriggersSingles> list){
    List<Integer> tidList = new ArrayList<>();
    for(ActorTriggersSingles single:list){
      if(!tidList.contains(single.getActorSingleId()))
        tidList.add(single.getActorSingleId());
    }
    return tidList;
  }

}
